function userLogin(iv, encryptedData, signature, rawData) {
  return new Promise((resolve, reject) => {
    wx.login({
      success: (res) => {
        wx.request({
          //本地回环地址
          // url: 'http://localhost:8089/login',
          //本地ipv4
          url: 'http://192.168.18.149:8089/login',
          method: "POST",
          data: {
            code: res.code,
            iv: iv,
            encryptedData: encryptedData,
            signature: signature,
            rawData: rawData
          },
          success(res) {
            wx.setStorageSync('isLogin', true)
            wx.setStorageSync('token', res.data.data.token)
            resolve(res.data.data) //返回数据
          },
          fail(err) {
            // Toast.fail('登陆失败');
            console.log("调用后台失败！！！")
            reject(err)
          }
        })
      },
    })
  })

}

export {
  userLogin
}